<!--
 * @Description: 美食
 * @Author: ZhangHan
 * @Date: 2025-07-24 17:51:56
 * @LastEditTime: 2025-09-16 16:47:14
 * @LastEditors: ZhangHan
-->
<template>
  <view
    >美食页

    <view>
      <ProRadioSelect :option="myOptions" v-model:checked="selset" />
    </view>
    <button @click="handleGo(0)">跳转api测试</button>
    <!-- #ifdef MP-WEIXIN -->
    <button @click="handleGo(1)">跳转测试相机功能</button>

    <button @click="handleApi()">获取电量</button>

    <!-- #endif -->
    <button @click="handleGame()">3d画廊测试</button>
  </view>
</template>

<script setup lang="ts">
import { ref } from "vue";
//如果未生效 重启
import ProRadioSelect from "@/components/ProRadioSelect/ProRadioSelect.vue";
import { useGo } from "@/hooks/usePage";
import { ROUTER_PATH } from "@/concacts/routerPath";
import { getBeary } from "@/utils/common";
import { translateZhToJp } from "@/api/translate";
import { onShow } from "@dcloudio/uni-app";

const go = useGo();
const selset = ref(1);

const myOptions = [
  {
    label: "香蕉a",
    value: 1,
  },
  {
    label: "榴莲a",
    value: 2,
  },
  {
    label: "西瓜a",
    value: 3,
  },
];

onShow(async () => {
  const res = await translateZhToJp({
    query: "你好",
  });
  console.log(res);
  
});

const handleGo = (num: number) => {
  const pathArr = [
    ROUTER_PATH.APITEST,
    ROUTER_PATH.MYCAMERA,
    ROUTER_PATH.MYECHARTS + `?type=1&cardId=4109202002020222`,
  ];
  go(pathArr[num]);
};

const handleApi = () => {
  getBeary();
};
const handleGame = () => {
  go(ROUTER_PATH.GAME);
};
</script>

<style></style>
